﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Honestysoft.Baseframework.WebUI;

namespace Honestysoft.Financing.WebUI.Module.Reports
{
    public partial class MonthReport : BasePage
    {
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindYear();
                BindMonth();
                ddlTheYear.SelectedValue = DateTime.Today.Year.ToString();
                ddlMonth.SelectedValue = DateTime.Today.Month.ToString();
            }
        }
        /// <summary>
        /// 绑定自2011至今日的年度
        /// </summary>
        private void BindYear()
        {
            int year = 2011;
            while (year <= DateTime.Today.Year)
            {
                ddlTheYear.Items.Add(new ListItem(year.ToString(), year.ToString()));
                year++;
            }
            ddlTheYear.SelectedValue = DateTime.Today.Year.ToString();
        }

        private void BindMonth()
        {
            for (int iNum = 1; iNum <= 12; iNum++)
            {
                ListItem li = new ListItem(iNum.ToString(), iNum.ToString());
                ddlMonth.Items.Add(li);
            }
        }
    }
}